<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="参数类型" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addType()"
                            ng-disabled="!btnPermission.paramClassAdd"
                            translate translate-attr-title="{{!btnPermission.paramClassAdd?'无权限执行此操作':''}}">新增</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="searchType()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                    </div>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" translate translate-attr-placeholder="参数类型" ng-model="conditionType.name">
                        <span class="input-group-addon cursor-pointer" ng-click="searchType(1)" translate>搜索</span>
                    </div>
                </div>
            </div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table border-none">
                            <thead>
                            <tr>
                                <th width="25%" translate>参数类型</th>
                                <th width="25%" translate>类型编码</th>
                                <th width="30%" translate>备注</th>
                                <th width="150" translate>操作</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="typeList.length > 0">
                        <table class="table border-none">
                            <tbody>
                            <tr ng-repeat="item in typeList track by $index">
                                <td width="25%" class="spill-dots" title="{{item.name}}">
                                    <button class="btn btn-operate" translate ng-click="getChildData(item)">{{item.name}}</button>
                                </td>
                                <td width="25%" class="spill-dots" title="{{item.code}}">{{item.code}}</td>
                                <td width="30%" class="spill-dots" title="{{item.remark}}">{{item.remark}}</td>
                                <td width="150">
                                    <button class="btn btn-operate" ng-click="addData(item)"
                                            ng-disabled="!!item.privated || !btnPermission.paramClassAdd"
                                            translate translate-attr-title="{{!btnPermission.paramClassAdd?'无权限执行此操作':''}}">添加参数</button>
                                    <button class="btn btn-operate" ng-click="editType(item)"
                                            ng-disabled="!!item.privated || !btnPermission.paramClassEdit"
                                            translate translate-attr-title="{{!btnPermission.paramClassEdit?'无权限执行此操作':''}}">编辑</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="typeList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="typePageInfo" yb-refresh="searchType()"></div>
            </div>
        </div>
        <div tab heading="{{parentType.name}}" active="activeFlag[1]" ng-if="!!parentType.name&&knowChildren">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addData(parentType)"
                            ng-disabled="!!parentType.privated || !btnPermission.paramClassAdd"
                            translate translate-attr-title="{{!btnPermission.paramClassAdd?'无权限执行此操作':''}}">新增</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="searchData()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                    </div>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" translate translate-attr-placeholder="参数名称" ng-model="conditionData.name">
                        <span class="input-group-addon cursor-pointer" ng-click="searchData(1)" translate>搜索</span>
                    </div>
                </div>
            </div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table border-none">
                            <thead>
                            <tr>
                                <th width="45%" translate>参数名称</th>
                                <th width="20%" translate>参数编码</th>
                                <th width="20%" translate>备注</th>
                                <th width="120" translate>操作</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0">
                        <table class="table border-none">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index">
                                <td width="45%" class="spill-dots" title="{{item.name}}">{{item.name}}</td>
                                <td width="20%" class="spill-dots" title="{{item.code}}">{{item.code}}</td>
                                <td width="20%" class="spill-dots" title="{{item.remark}}">{{item.remark}}</td>
                                <td width="120">
                                    <button class="btn btn-operate" ng-click="editData(item)"
                                            ng-disabled="!!item.privated || !btnPermission.paramClassEdit"
                                            translate translate-attr-title="{{!btnPermission.paramClassEdit?'无权限执行此操作':''}}">编辑</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="dataPageInfo" yb-refresh="searchData()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[2]" ng-if="activeFlag[2]">
            <div class="main-area d-t-35">
                <form name="dataForm" class="main-wrap form-horizontal single-col p-t clearfix" novalidate>
                    <div class="form-group" ng-if="!!parentType.name">
                        <label class="col-xs-2 control-label"><span translate>参数类型</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <div class="txt-show p-t-xs" translate>{{parentType.name}}</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i>{{(!!parentType.name?'参数名称':'参数类型')|translate}}：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="name" class="form-control" ng-model="detailInfo.name" maxlength="50" required yb-focus>
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="dataForm.name.$dirty || (dataForm.name.$invalid && submitted)">
                            <div class="error-msg" ng-if="dataForm.name.$error.required && !dataForm.name.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i>{{(!!parentType.name?'参数编码':'类型编码')|translate}}：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="code" class="form-control" ng-disabled="detailInfo.pId == '0'&&tabFlag.type == 1" ng-model="detailInfo.code" maxlength="20" required yb-focus>
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="dataForm.code.$dirty || (dataForm.code.$invalid && submitted)">
                            <div class="error-msg" ng-if="dataForm.code.$error.required && !dataForm.code.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><span translate>备注</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="remark" class="form-control" ng-model="detailInfo.remark" maxlength="200">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"></label>
                        <div class="col-xs-5 wrapper-none">
                            <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(dataForm.$valid)" translate>
                                保存
                            </button>
                            <button type="button" class="btn btn-default" ng-click="cancel()" translate>取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>